<?php
/**
 * 注解控制器
 */

namespace App\Http\Controllers;


use Spatie\RouteAttributes\Attributes\Any;
use Spatie\RouteAttributes\Attributes\Get;
use Spatie\RouteAttributes\Attributes\Prefix;
use Spatie\RouteAttributes\Attributes\Route;

#[Prefix('open/ann')]
class AnnotationController extends Controller
{
    /**
     * curl /open/ann
     */
    #[Any('/')]
    #[Get('/index')]
    public function index()
    {
        return "第一个注解路由";
    }

    /**
     * curl /open/ann/config
     */
    #[Any('/config')]
    public function config()
    {
        return [config('route-attributes'), config('custom-route-attributes')];
    }
}
